apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cc-door-mgr
    zgroup: grpcExample
  name: cc-door-mgr
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cc-door-mgr
  template:
    metadata:
      labels:
        app: cc-door-mgr
        zgroup: grpcExample
    spec:
      containers:
      - name: cc-door-mgr
        image: docker.io/cilium/cc-grpc-demo:v3.0
        imagePullPolicy: IfNotPresent
        command: ["python3"]
        args: ["/cloudcity/cc_door_server.py"]
        ports:
        - containerPort: 50051
          name:          grpc
        livenessProbe:
          tcpSocket:
            port: 50051
          initialDelaySeconds: 30
          failureThreshold: 10
          periodSeconds: 10
        readinessProbe:
          tcpSocket:
            port: 50051
          initialDelaySeconds: 5
          periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: cc-door-server
    zgroup: grpcExample
  name: cc-door-server
spec:
  ports:
  - port: 50051
    protocol: TCP
    targetPort: 50051
  selector:
    app: cc-door-mgr
  sessionAffinity: None
  type: ClusterIP
---
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: public-terminal
    zgroup: grpcExample
  name: terminal-87
spec:
  containers:
  - name: cc-door-client
    image: docker.io/cilium/cc-grpc-demo:v3.0
    imagePullPolicy: IfNotPresent
    command: ["sleep"]
    args: ["300000"]
